<?php
session_start();
include ('main_login.php');
include ('mysqlfunctions.php');
?>
<html>
	<head>
		<style>
		html {
			padding: 0;
			margin: 0;
			border-spacing: 0;
			height: 100%;
			width: 100%
		}
		body {
			margin: 0;
			padding: 0;
			border-spacing: 0;
			height: 100%;
			width: 100%
		}
		div.box { background: #EEE; height: 100%; width: 100%; clear:right;padding: 0px; border-spacing: 0; margin:0}
		div.div1{ background: #EEE; float: left; height: auto; width: 100%; clear:right; border-spacing: 0; padding:0; margin:0 }
		div.div2{ background: #372; height: 100%; width: 100%; }
		div.clear { clear: both; height: 1px; overflow: hidden; font-size:0pt; margin-top: -1px; }
		</style>
		
		<script type="text/javascript">
		function convertToPassword() {
			  document.getElementById('mypassword').type="password";
			  alert("HO");
		}
		</script>
	</head>
	
	<body>
	<div class="box">
	   <div class="div1">
		<h1>
		<?php 
		if ( isset( $_SESSION['myusername'] ) ) {
			logout();
		}
		else {
			login();
			if ( isset( $_SESSION['loginerror'] ) ) {
				echo "<script>alert(\"Username or Password is incorrect.\");</script>";
			    unset($_SESSION['loginerror']);
			}	
		}
		?> 
		</h1>
		</div>
	   <div class="div2">
	   	
	   </div>
	   <div class="clear">
	</div>
	</body>
</html>
